# 使用linux:alpine,jdk:oracle jdk-1.8版本
FROM frolvlad/alpine-java:jdk8-slim

# 维护人员
MAINTAINER sdevil507

# 拷贝阿里巴巴Arthas监控到容器中
COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas

# 切换alpine镜像源为阿里云
RUN echo -e "http://mirrors.aliyun.com/alpine/latest-stable/main\n\
http://mirrors.aliyun.com/alpine/latest-stable/community" > /etc/apk/repositories

# 安装tzdata
RUN apk --update add tzdata \
  # 设置时区为东八区(上海)
  && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
  && echo "Asia/Shanghai" > /etc/timezone \
  && apk del tzdata \
  && rm -rf /var/cache/apk/*

# app发布目录
RUN mkdir -p /deployments

# JAVA_APP_DIR is used by run-java.sh for finding the binaries
ENV JAVA_APP_DIR=/deployments

# Add run script as /deployments/run-java.sh and make it executable
COPY run-java.sh /deployments/
RUN chmod 755 /deployments/run-java.sh

CMD [ "/deployments/run-java.sh" ]